package com.sol.mapreduce._6_writable_comparable_partition;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @author: lujie
 * @date: 2021/11/28 13:47
 **/
public class FlowReducer extends Reducer<FlowBean, Text , Text, FlowBean> {

    @Override
    protected void reduce(FlowBean key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
       // 循环输出避免通一 FlowBean 对应 多个手机号
        for (Text phone : values) {
            context.write(phone,key);
        }
    }
}
